package com.yxh.springdemo.service.Impl;

import com.yxh.springdemo.bean.Student;
import com.yxh.springdemo.service.StudentService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author: yuxinhang
 * @Date: 2022/6/14 16:19
 * @Description
 */
public class StudentServiceImpl implements StudentService {

    public Student getStudent() {
        //构造器注入
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");
        return applicationContext.getBean(Student.class);
    }
}
